package com.richard.base.provider

import org.greenrobot.eventbus.EventBus

/**
 * **************************************
 * 项目名称:凯叔讲故事
 *
 * @Author Whg
 * 邮箱：guanhuawei@ksjgs
 * 创建时间: 2019-12-17     19:04
 * 修改时间: 2019-12-17     19:04
 * 描述：EventBus生成单例对象
 * **************************************
 */
object BusProvider {
    @Volatile
    private var mInsance: EventBus? = null

    /**
     * 生成单例对象
     *
     * @return 单例对象
     */
    val instance: EventBus?
        get() {
            if (mInsance == null) {
                synchronized(EventBus::class.java) {
                    if (null == mInsance) {
                        mInsance = EventBus()
                    }
                }
            }
            return mInsance
        }
}